<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title th:text="${wbeParameter.name}">网站后台管理系统 </title>
    <link rel="icon" href="/resource/hospital.png"/>
    <link rel="stylesheet" href="/resource/css/normalize.css" type="text/css"/>
    <link rel="stylesheet" href="/resource/css/secondary.css" type="text/css"/>
    <link rel="stylesheet" href="/resource/common/layui/css/layui.css" media="all"/>
    <script language="javascript" type="text/javascript" src="/resource/js/Kunyilibrary.js"></script>
</head>
<style>

    .layui-input {
        margin-top: 5px;
    }

    .layui-table tr th {
        color: #6bcbca !important;
        font-family: 微软雅黑;
    }
</style>
<body style="font-size: 12px;">
<header class="header" th:replace="proscenium/public :: header"></header>
<nav th:replace="proscenium/public :: nav"></nav>
<section class="BaseMark">
    <div class="bread">您所在的位置<span><a href="/diplomaProject">首页</a>><a>缴费信息</a></span></div>
    <div class="baseLeft">
        <div class="tools">
            <a href="/pay">
                <img src="/resource/images/ico_003.gif" width="52" height="52"><em>缴费</em>
            </a>
            <a style="margin-right:0;" href="/infoSearch" class="last">
                <img src="/resource/images/ico_004.gif" width="52" height="52"><em>信息查询</em>
            </a>
            <a style="margin-right:0;" href="/showHistory">
                <img src="/resource/images/ico_001.gif" width="52" height="52"><em>缴费记录</em>
            </a>
            <div class="clear"></div>
        </div>
    </div>
    <div class="baseRight">
        <div class="title01">缴费信息</div>


        <div class="clearfix administrator_style" id="administrator">
            <div class="compete_list" id="testIframe">
                <table id="table-list" data-mobile-responsive="true" lay-filter="table-list"></table>
            </div>
        </div>
    </div>
</section>
<div class="BottomHidden"></div>
<footer th:replace="proscenium/public :: footer"></footer>
<script language="javascript" type="text/javascript" src="/resource/js/Kunyi.Common.js"></script>
<script language="javascript" type="text/javascript" src="/resource/js/Kunyi.Secondary.js"></script>
<script type="text/javascript" src="/resource/common/layui/layui.js"></script>
<script type="text/javascript" th:inline="javascript">
   layui.use(['table', 'layer', 'form'], function () {
        var table = layui.table,
            $ = layui.$,
            layer = layui.layer,
            form = layui.form;
        var tableIns = table.render({
            elem: '#table-list'
            , even: true
            , url: '/order/orderMyself.do' //数据接口
            , method: 'get'
            , toolbar: '#toolbar'
            , page: true //开启分页
            , id: 'tableId'
            , smartReloadModel: true
            , limits: [10, 15, 30]
            , limit: 5
            , cols: [
                [
                    {field: 'name', title: '缴费项目'},
                    {field: 'price', title: '价格'},
                    {field: 'caseUuId', title: '病例编号'},
                    {field: 'userName', title: '用户名'},
                    {field: 'realName', title: '姓名'},
                    {field: 'time', title: '开单时间'},
                    {field: 'state', title: '状态'}
                ]
            ]
        });
        $('.addPage').on('click', function () {
            layer.open({
                type: 2,
                shadeClose: false, //点击遮罩关闭层
                title: "开单",
                area: ['45%', '70%'],
                content: "/order/addPage.do"
            });
        });
        $('.addItem').on('click', function () {
            layer.open({
                type: 2,
                shadeClose: false, //点击遮罩关闭层
                title: "开单",
                area: ['45%', '70%'],
                content: "/order/addItem.do"
            });
        });
        //监听工具条
        table.on('tool(table-list)', function (obj) {
            var data = obj.data;
            if (obj.event === 'del') {
                layer.confirm('确定要删除吗?', function (index) {
                    $.ajax({
                        url: "/order/order.do",
                        type: "post",
                        data: {_method: "DELETE", "id": data.id},
                        dataType: "json",
                        success: function (result) {
                            if (!result.status) {
                                layer.msg(result.msg, {time: 2000});
                                return false;
                            }
                            layer.msg("删除成功!", {time: 1000});
                            active.reload();
                        }
                    });
                    layer.close(index);
                })
            }
        });
        //搜索
        $('.search').on('click', function () {
            active.reload()
        });
        //撤销
        $(".revocation").on('click', function () {
            $("#caseUuId").val("");
            $("#userName").val("");
            $("#realName").val("");
            form.render();
            active.reload()
        });
        active = {
            reload: function () {
                var caseUuId = $("#caseUuId").val();
                var userName = $("#userName").val();
                var realName = $("#realName").val();
                //执行重载
                table
                    .reload('tableId', {
                        where: {
                            caseUuId: caseUuId,
                            userName: userName,
                            realName: realName,
                        }
                    });
            }
        };
    });
</script>
</body>
</html>